#pragma once

#include "esp_system.h"
#include "string.h"

void nvsInit(void);

bool nvsRead_i8(const char* storageNameSpace, const char* dataNameSpace, int8_t* out_value);
bool nvsRead_u8(const char* storageNameSpace, const char* dataNameSpace, uint8_t* out_value);
bool nvsRead_i16(const char* storageNameSpace, const char* dataNameSpace, int16_t* out_value);
bool nvsRead_u16(const char* storageNameSpace, const char* dataNameSpace, uint16_t* out_value);
bool nvsRead_i32(const char* storageNameSpace, const char* dataNameSpace, int32_t* out_value);
bool nvsRead_u32(const char* storageNameSpace, const char* dataNameSpace, uint32_t* out_value);
bool nvsRead_i64(const char* storageNameSpace, const char* dataNameSpace, int64_t* out_value);
bool nvsRead_u64(const char* storageNameSpace, const char* dataNameSpace, uint64_t* out_value);
bool nvsRead_str(const char* storageNameSpace, const char* dataNameSpace, char* out_value, size_t* len);


bool nvsWrite_i8(const char* storageNameSpace, const char* dataNameSpace, int8_t out_value);
bool nvsWrite_u8(const char* storageNameSpace, const char* dataNameSpace, uint8_t out_value);
bool nvsWrite_i16(const char* storageNameSpace, const char* dataNameSpace, int16_t out_value);
bool nvsWrite_u16(const char* storageNameSpace, const char* dataNameSpace, uint16_t out_value);
bool nvsWrite_i32(const char* storageNameSpace, const char* dataNameSpace, int32_t out_value);
bool nvsWrite_u32(const char* storageNameSpace, const char* dataNameSpace, uint32_t out_value);
bool nvsWrite_i64(const char* storageNameSpace, const char* dataNameSpace, int64_t out_value);
bool nvsWrite_u64(const char* storageNameSpace, const char* dataNameSpace, uint64_t out_value);
bool nvsWrite_str(const char* storageNameSpace, const char* dataNameSpace, char* out_value, size_t* len);